package com.code.day10;

public class Test01 {
    public static void main(String[] args) {
        double a = 10;
        System.out.println( a);
        //原始方式
        //Dog dog = new Dog();
        //dog.eat();
        //dog.lookHome();
        //
        //dog = new Cat();
        Dog dog = new Dog();
        method(dog);

        Cat cat = new Cat();
        method(cat);

       /* Pig pig = new Pig();
        method(pig);*/

    }

    public static void method(Dog dog){
        dog.eat();
    }

    public static void method(Cat cat){
        cat.eat();
    }

   /* public static void method(Pig pig){
        pig.eat();
    }*/
}
